<?php
//
//  VictoryCMS - Content managment system and framework.
//  Copyright (C) 2009  Lewis Gunsch
//
//  This file is part of VictoryCMS.
//  
//  VictoryCMS is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  VictoryCMS is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with VictoryCMS.  If not, see <http://www.gnu.org/licenses/>.

/**
 * VictoryCMS - MembersHome
 * 
 * @license http://www.gnu.org/licenses/gpl.html
 * @author Lewis Gunsch
 * @package Deprecated
 */

/**
 * @deprecated This class will be removed in future versions!
 * 
 * This class contains the functions necessary to display
 * the members home web portal.
 * 
 * @package Deprecated
 */
class MembersHome implements DisplayablePage {

	/**
	 * Pages to be listed into navigation container
	 **/
	private static $nav_list = array(
	1=>array( 1=>true, 2=>"MembersHome", 3=>"Members Portal" ),
	2=>array( 1=>true, 2=>"EventManager", 3=>"Event Manager" ),
	3=>array( 1=>true, 2=>"UserManager", 3=>"User Manager" ),
	4=>array( 1=>true, 2=>"PreferencesManager", 3=>"My Account"),
//	5=>array( 1=>false, 2=>"http://www.victoryrock.org/forum", 3=>"Rock Talk"),
	5=>array( 1=>true, 2=>"Documents", 3=>"Document Manager")
	);

	/**
	 * This function returns the title of the MembersHome page
	 * in a string.
	 *
	 * @return The title of the page
	 **/
	public function getTitle() {
		return "Members";
	}

	/**
	 * This function returns the name of the DisplayablePage
	 * in a string.
	 *
	 * @return The name of the page.
	 **/
	public function getName() {
		return "Members";
	}

	/**
	 * This function returns a short text description of a
	 * DisplayablePage in a string.
	 *
	 * @return A short description of the page
	 **/
	public function getDescription() {
		return "victory church on the rock members portal.";
	}

	/**
	 * This function returns a comma seperated list
	 * of describing keywords in a string.
	 *
	 * @return A comma seperated keyword string
	 **/
	public function getKeywords() {
		return "";
	}


	/**
	 * This function returns the css style sheet
	 * in a string for the page.
	 *
	 * @return The css stylesheet for the page in a string
	 */
	public function getHeaderInfo() {
		$html = "";
		$html .= '<link href="http://www.victoryrock.org/members/vcotr1style.css" rel="stylesheet" type="text/css">';
		$html .= '<script src="http://www.victoryrock.org/members/vcotr1javascript.js" type="text/javascript"></script>';
		return $html;
	}

	/**
	 * This function returns the html content of the page in a string.
	 * The content should not contain the template, just the page container
	 * content. The current page parameter should be set to the relative page
	 * path calling this function.
	 *
	 * @param currentPage The current relative page path calling this function.
	 *
	 * @return A string containing the html page content
	 **/
	public function renderPage( $currentPage ) {
		$html = "";
		$html .= "<div id='Links_List_Container' style='display: inline;'>\n";
		$html .= "<div id='Admin_Links_Container'>\n";
		$html .= "<strong>Goto:</strong>\n";
		$html .= "<ul>\n";
		
		$settings = new VcmsSettings();
		foreach ( self::$nav_list as $page_name ) {
			if ( $page_name[1] ) {
				$html .= "<li><a href='/index.php?page=$page_name[2]'>$page_name[3]</a></li>\n";
			} else {
				$html .= "<li><a href='$page_name[2]'>$page_name[3]</a></li>\n";
			}
		}
		unset( $page_name );
		$html .= "</ul></div></div>";

		return $html;
	}

	/**
	 * This method is run before the page is displayed and
	 * before any content is retrieved. This method is meant
	 * to let the page do any necessary preprocessing.
	 *
	 **/
	public function pagePreProcess() {
		// nothing to handle yet
		return;
	}

	/**
	 * This method returns the minimum necessary permissions
	 * needed to be able to view this page.
	 *
	 * @return Permission a permission object with permission set.
	 **/
	public function getPagePermissionLevel() {

		return new Permission("General User");
	}
}

?>